/**
 * Created by status200 on 2017/9/3.
 *
 * 房间选择Controller
 */
define([
    "app"
], function (app) {
    app.controller("selectRoomController", [
            "$scope",
            "selectRoomDataService",
            function ($scope, selectRoomDataService) {

                // 数据加载中
                $scope.state = "loading";

                selectRoomDataService
                    .getRoomStatistic()
                    .then(
                        function success(resp) {
                            // 数据加载完毕
                            $scope.state = "finished";

                            $scope.rooms = resp.data;
                        },
                        function error(resp) {
                            $scope.state = "error";
                        }
                    )
            }
        ]
    );
});